home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 43 / Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso / -serious- / programming / other / flexcat / contribution / lmake < prev    next >
AmigaDOS Script File  |  1999-06-14  |  3KB  |  119 lines

  1. .key BASENAME/A,CAT/S,NOCT/S,SRC/S,SD/K
  2. .bra {
  3. .ket }
  4.  
  5. ;flexcat catalog creation script
  6. ;
  7. ;$VER: LMake V1.05 (02.10.97) Kai Norhausen (kn@tribal.line.org)
  8. ;
  9. ;just create a valid .cd [catalog description] file and run this
  10. ;script.
  11. ;
  12. ; Template: BASENAME/A,CAT/S,NOCT/S,SRC/S,SD/K
  13. ;
  14. ;           BASENAME =  The name of the project without extensions.
  15. ;                       The script will use <name>.cd and create
  16. ;                       <name>_<language>.ct and <name>.src , if
  17. ;                       specified by SRC switch
  18. ;
  19. ;           CAT      =  Create <basename>.catalog in
  20. ;                       locale:catalogs/<language>/
  21. ;
  22. ;           NOCT     =  Do not create or update catalog translation
  23. ;                       file  (.ct)
  24. ;
  25. ;           SRC      =  Activate Source creation
  26. ;
  27. ;           SD       =  Name of the FlexCat Source-Description
  28. ;                       (without .sd)
  29. ;                       This script will then create sourcecode
  30. ;                       <basename>.src
  31. ;                       (see Flexcat documentation)
  32. ;
  33.  
  34. ; ################### START OF USER PREFERENCES #####################
  35.  
  36. ; Specify full Path and Name of flexcat-program
  37.  
  38. Set flexname Tools:FlexCat/Flexcat
  39.  
  40. ; Flexcat options for catalog creation (see flexcat.guide)
  41.  
  42. Set flexopts FLUSH FILL
  43.  
  44. ; ###################  END OF USER PREFERENCES  #####################
  45.  
  46. FailAt 21
  47. Set minver 1
  48. Set minrev 9
  49.  
  50. ; Works with FlexCat x.y+ only
  51. C:Version >NIL: $flexname VERSION $minver REVISION $minrev
  52. If WARN
  53.    Echo "Sorry, you need FlexCat $minver.$minrev or above"
  54.    UnSet minrev
  55.    UnSet minver
  56.    UnSet flexname
  57.    UnSet flexopts
  58.    Quit 10
  59. EndIf
  60.  
  61. ;Setup
  62. Set basename {basename}                  ;name of program
  63. Set catbase LOCALE:catalogs              ;home Path of catalogs
  64. Set catdir $catbase/$language            ;add dirname
  65.  
  66. ;update/create  <basename>.ct  [catalog-translation]
  67. If {NOCT} NOT EQ "NOCT"
  68.    If Exists $basename_$language.ct
  69.       Echo "Updating $basename_$language.ct .... " NOLINE
  70.       $flexname $basename.cd $basename_$language.ct NEWCTFILE $basename_$language.ct
  71.    Else
  72.       Echo "Creating $basename_$language.ct .... " NOLINE
  73.       $flexname $basename.cd newctfile $basename_$language.ct
  74.    EndIf
  75.    If WARN
  76.       Echo "FAILED"
  77.       Quit 10
  78.    EndIf
  79.    Echo "OK"
  80. EndIf
  81.  
  82. ;create <basename>.catalog
  83. If {cat} EQ "CAT"
  84.    Echo "Creating $basename.catalog .... " NOLINE
  85.    $flexname $basename.cd $basename_$language.ct CATALOG $catdir/$basename.catalog $flexopts
  86.    If WARN
  87.       Echo "FAILED"
  88.       Quit 10
  89.    EndIf
  90.    Echo "OK"
  91. EndIf
  92.  
  93. ;Source creation process
  94. If {src} EQ "SRC"
  95.    If {sd} NOT GT ""
  96.       Echo "No source-description specified."
  97.       Quit 10
  98.    Else
  99.       Echo "Creating Source  .... " NOLINE
  100.       $flexname $basename.cd $basename.src={SD}.sd     ;create source
  101.       If WARN
  102.          Echo "FAILED"
  103.          Quit 10
  104.       EndIf
  105.       Echo "OK"
  106.    EndIf
  107. EndIf
  108.  
  109. ;clean up and exit
  110. UnSet flexname
  111. UnSet flexopts
  112. UnSet basename
  113. UnSet catdir
  114. UnSet catbase
  115. UnSet minver
  116. UnSet minrev
  117. Quit
  118.  
  119.